In our current project (like gnoswap), when a package is needed, we handle it by directly implementing it in the p/demo directory of the forked Gno repository. This approach requires uploading all packages to the repository, resulting in a significant increase in the size of the repository. Additionally, it has been problematic having to run make install every time we use each repository.
To solve these issues, I propose introducing a gno get command, similar to the package management approach of the Go language. By inputting the address of the package (for example: github.com/xxx/xxx), it automatically adds and manages the dependencies. The specific method is as follows:
Once the package information is recognized, update the gno.mod file to determine the correct version of the package and record a checksum to ensure its integrity (we consider creating a separate file like go.sum or Rust's Cargo.lock that stores only the checksum). At this stage, the package is not downloaded, only recorded.
When building or testing the project, the gno.mod file is checked to identify the necessary dependencies. Packages are downloaded and compiled only if necessary. The downloaded packages are stored in Gno's module cache and can be placed in an arbitrary directory such as $GNOPATH/pkg/mod.
In our current project (like
gnoswap
), when a package is needed, we handle it by directly implementing it in thep/demo
directory of the forked Gno repository. This approach requires uploading all packages to the repository, resulting in a significant increase in the size of the repository. Additionally, it has been problematic having to run make install every time we use each repository.To solve these issues, I propose introducing a
gno get
command, similar to the package management approach of the Go language. By inputting the address of the package (for example:github.com/xxx/xxx
), it automatically adds and manages the dependencies. The specific method is as follows:Once the package information is recognized, update the
gno.mod
file to determine the correct version of the package and record a checksum to ensure its integrity (we consider creating a separate file likego.sum
or Rust'sCargo.lock
that stores only the checksum). At this stage, the package is not downloaded, only recorded.When building or testing the project, the
gno.mod
file is checked to identify the necessary dependencies. Packages are downloaded and compiled only if necessary. The downloaded packages are stored in Gno's module cache and can be placed in an arbitrary directory such as$GNOPATH/pkg/mod
.