mirror of
https://github.com/fluencelabs/eip712-validation-node
synced 2025-06-24 04:01:49 +00:00
add client
This commit is contained in:
47
client-peer/src/index.ts
Normal file
47
client-peer/src/index.ts
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 = "12D3KooWSD5PToNiLQwKDXsu8JSysCwUt8BVUJEqCHcDe7P5h45e";
|
||||
const RELAY_ID: string = "12D3KooWSD5PToNiLQwKDXsu8JSysCwUt8BVUJEqCHcDe7P5h45e";
|
||||
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(error);
|
||||
process.exit(1);
|
||||
});
|
Reference in New Issue
Block a user