48 lines
1.5 KiB
TypeScript

/*
* Copyright 2021 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Fluence, KeyPair } from "@fluencelabs/fluence";
import { krasnodar } from "@fluencelabs/fluence-network-environment";
import { validate } from "./_aqua/demo_validation";
const NODE_ID: string = "12D3KooWFCY8xqebtZqNeiA5took71bUNAedzCCDuCuM1QTdTbWT";
const RELAY_ID: string = krasnodar[0].peerId;
const EIP_URL: string = "https://ipfs.fleek.co/ipfs/QmWGzSQFm57ohEq2ATw4UNHWmYU2HkMjtedcNLodYywpmS";
async function main() {
await Fluence.start({
connectTo: krasnodar[0],
});
console.log("application started");
console.log("peer id is: ", Fluence.getStatus().peerId);
console.log("relay is: ", Fluence.getStatus().relayPeerId, "\n\n");
const result = await validate(EIP_URL, NODE_ID, RELAY_ID);
console.log("validation result: ", result);
await Fluence.stop();
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error('something went wrong: ', error);
process.exit(1);
});