automata-network / automata Goto Github PK
View Code? Open in Web Editor NEWAutomata Network is a modular attestation layer that extends machine trust to Ethereum with TEE Coprocessors.
Home Page: https://ata.network
License: Apache License 2.0
Automata Network is a modular attestation layer that extends machine trust to Ethereum with TEE Coprocessors.
Home Page: https://ata.network
License: Apache License 2.0
Now start the development network using the BABE
algorithm.If there is only a single node, the network will not function properly after being shut down for a period of time, which is not conducive to internal testing.
So it makes more sense to change the BABE
algorithm to the AURA
algorithm.
The error message:
ClientImport("Unexpected epoch change")
We can use subkey
to generate a sr25519 key pair, we will get the Secret Seed
and Account ID
, Account ID
is the substrate address
(let us call it as addressA
), and you can genarate the private key using this secret seed.
Besides, we can import the generated private key into Metamask and get a corresponding evm address
(call it addressB
), but actually these 2 addresses are address of 2 different account.
We can do a experimentation:
Then you can use code below to calculate a substrate address from the evm address, <evm address>
is the address in Metamask without leading 0x
use blake2::VarBlake2b;
use blake2::digest::{Update, VariableOutput};
use hex;
fn main() {
// create a Blake2b object
let mut hasher = VarBlake2b::new(32).unwrap();
// write input message
let mut data = [0_u8; 24];
data[0..4].copy_from_slice(b"evm:");
data[4..24].copy_from_slice(&hex::decode("<evm address>").unwrap());
hasher.update(&data);
// read hash digest and consume hasher
let _res = hasher.finalize_variable(|res| {
println!("{:?}", hex::encode(&res[..]));
});
}
you will get a string like 65f5fbd10250447019bb8b9e06f6918d033b2feb6478470137b1a552656e2911
by running code above, then come back to blockchain explorer, paste the string here(we will get a another address, call it addressC ) and call account function:
you will find that balance of this account is 10 ATA(or 10 BATA)
The result verifies that actually addressA
and addressB
are 2 different account in our chain, addressB
and addressC
are same account in our chain.
Currently, assume that someone have some ata in his evm address account, and he want to interact(send extrinsics) with our chain, it is impossible because he doesn't know the private key of corresponding substrate address.
So maybe we need to change the mapping methods in evm pallet, take the previous example, we should mapping addressA
to addressB
if we send a estimateGas call to proxy contract, the function return a huge value like '288230376151821754'
When I execute the following command in readme.md, to test how to setup an environment if we do some local changes.
./scripts/run-network.sh --build
It will occur error at the end of docker building:
Image: automata
Chain: local
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
Any suggestion about the this issue? The build will succeed if I specify the version form "3.7" to "3.3" and move it under the services
key, but not sure whether this change will impact our code or logic.
After the block has been initialized, each valid extrinsic is executed in order of transaction priority. Extrinsics must not cause a panic in the runtime logic or else the system becomes vulnerable to attacks where users can trigger computational execution without any punishment.
--Substrate Developer Hubautomata/pallets/attestor/src/lib.rs
Lines 218 to 219 in 3b11d55
We have imported these 2 pallets in the original testnet: https://github.com/automata-network/automata/blob/v2/node/runtime/src/lib.rs, but missing in v3.
Now if a validator is offline, the network will not know about it.
Compiling ed25519 v1.3.0 (https://github.com/RustCrypto/signatures.git?tag=ed25519/v1.3.0#8282fcaf)
error[E0405]: cannot find trait Signature
in crate signature
--> /home/user/.cargo/git/checkouts/signatures-a6df6df1cc32e789/8282fca/ed25519/src/lib.rs:349:17
|
349 | impl signature::Signature for Signature {
| ^^^^^^^^^ not found in signature
For more information about this error, try rustc --explain E0405
.
Compiling regex-automata v0.4.3
error: could not compile ed25519
(lib) due to previous error
warning: build failed, waiting for other jobs to finish...
cargo 1.75.0-nightly (6fa6fdc76 2023-10-10) - do not impact - many trials on diferent days after cargo update
automata$ cargo build
Compiling proc-macro2 v1.0.38
error[E0422]: cannot find struct, variant or union type LineColumn
in crate proc_macro
--> /home/am/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.38/src/wrapper.rs:485:33
|
485 | let proc_macro::LineColumn { line, column } = s.start();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn
, refer to it directly
|
485 - let proc_macro::LineColumn { line, column } = s.start();
485 + let LineColumn { line, column } = s.start();
|
error[E0422]: cannot find struct, variant or union type LineColumn
in crate proc_macro
--> /home/am/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.38/src/wrapper.rs:502:33
|
502 | let proc_macro::LineColumn { line, column } = s.end();
| ^^^^^^^^^^ not found in proc_macro
|
help: consider importing one of these items
|
1 + use crate::LineColumn;
|
1 + use crate::fallback::LineColumn;
|
help: if you import LineColumn
, refer to it directly
|
502 - let proc_macro::LineColumn { line, column } = s.end();
502 + let LineColumn { line, column } = s.end();
|
For more information about this error, try rustc --explain E0422
.
error: could not compile proc-macro2
(lib) due to 2 previous errors
Hi, I conduct build process according to instaction
I have installed docker and docker-compose
I have this problem:
a@s:~/progs/automata$ sudo ./scripts/run-network.sh
[sudo] hasło użytkownika adi:
Running the network
Image: automata
Chain: local
Pulling validator-a (automata:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
Continue with the new image? [yN]y
Pulling validator-a (automata:)...
ERROR: pull access denied for automata, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
a@s:~/progs/automata$ ./scripts/run-network.sh
Running the network
Image: automata
Chain: local
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
a@s:~/progs/automata$
How I can make automata running?
There is a corner case that could cause the chain having dirty data:
If an attestor get disconnected from chain, and not going to come back, the geode that it was attesting will remain in Registered
state forever, and no one would be responsible for checking the liveness of that geode to ensure it's in proper status.
Thus here are some TODOs for eliminate this corner case:
pi@pi4:~/automata $ cargo build --release
Compiling sct v0.6.0
Compiling webpki v0.21.4
Compiling wasm-timer v0.2.5
Compiling rw-stream-sink v0.2.1
Compiling soketto v0.4.2
Compiling yamux v0.8.1
Compiling libp2p-pnet v0.20.0
Compiling intervalier v0.4.0
Compiling futures-diagnose v1.0.1
Compiling exit-future v0.2.0
Compiling prost-build v0.7.0
error: failed to run custom build command for prost-build v0.7.0
Caused by:
process didn't exit successfully: /home/pi/automata/target/release/build/prost-build-0f2fe0256215a37a/build-script-build
(exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to find the protoc binary. The PROTOC environment variable is not set, there is no bundled protoc for this platform, and protoc is not in the PATH', /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/prost-build-0.7.0/build.rs:100:10
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
pi@pi4:~/automata $
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.